#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import time
import logging

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)


def main():
    
    # 检查环境变量
    mysql_host = os.getenv('MYSQL_HOST', 'localhost')
    mysql_port = os.getenv('MYSQL_PORT', '3306')
    mysql_db = os.getenv('MYSQL_DATABASE', 'judge_db')
    
    logger.info(f"MySQL 配置: {mysql_host}:{mysql_port}/{mysql_db}")
    logger.info(f"临时目录: /app/temp")
    logger.info(f"脚本目录: /app/scripts")
    
    
    logger.info("判题服务已启动，等待任务...")
    
    try:
        while True:
            time.sleep(60)
            logger.debug("判题服务运行中...")
    except KeyboardInterrupt:
        logger.info("判题服务正在关闭...")


if __name__ == "__main__":
    main()
